import config from "@/config"
import http from "@/utils/request"

export default {
	catalogue:{
		tree: {
			url: `${config.API_URL}/xunheng-file/catalogue/getAllList`,
			name: "上传目录树",
			get: async function(params){
				return await http.get(this.url,params);
			}
		},
		add:{
			url: `${config.API_URL}/xunheng-file/catalogue/add`,
			name: "保存上传目录",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		edit:{
			url: `${config.API_URL}/xunheng-file/catalogue/edit`,
			name: "编辑上传目录",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		delete:{
			url: `${config.API_URL}/xunheng-file/catalogue/delByIds/`,
			name: "删除上传目录",
			delete: async function(ids){
				return await http.delete(this.url+`${ids}`);
			}
		},

	},
	file: {
		list: {
			url: `${config.API_URL}/xunheng-file/file/getPageList`,
			name: "获取文件分页列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		upload: {
			url: `${config.API_URL}/xunheng-file/file/upload`,
			name: "文件上传",
			upload: async function(data, config={}){
				return await http.upload(this.url, data, config);
			}
		},
		delete:{
			url: `${config.API_URL}/xunheng-file/file/delByIds/`,
			name: "删除文件",
			delete: async function(ids){
				return await http.delete(this.url+`${ids}`);
			}
		},
		view: {
			url: `${config.API_URL}/xunheng-file/file/view/`,
			name: "预览图片",
			get: async function(id,params){
				return await http.get(this.url+`${id}`, params);
			}
		},
	},
	uploadSetting: {
		list: {
			url: `${config.API_URL}/xunheng-file/uploadSetting/getPageList`,
			name: "获取上传设置列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		save:{
			url: `${config.API_URL}/xunheng-file/uploadSetting/save`,
			name: "保存上传设置",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		edit:{
			url: `${config.API_URL}/xunheng-file/uploadSetting/edit`,
			name: "编辑上传设置",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		delete:{
			url: `${config.API_URL}/xunheng-file/uploadSetting/delByIds/`,
			name: "删除上传设置",
			delete: async function(ids){
				return await http.delete(this.url+`${ids}`);
			}
		}
	},

}
